<?php
// +----------------------------------------------------------------------
// | Desc: [ Better-卡分组 ]
// +----------------------------------------------------------------------
// | Author: huangzhen_20210406
// +----------------------------------------------------------------------

namespace app\common\model;

use think\facade\Db;

class UserToken extends Common
{
    /**
     * @param $data
     */
    public function setToken($data)
    {
        $ip     = ip();
        $token  = setToken($ip);
        Db::name('user_token')->save([
            'user_id'   => $data['user_id'],
            'token'     => $token,
            'ip'        => $ip,
            'ctime'     => getUtcTime()
        ]);
        return $token;
    }


}